﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using System.Data;
using System.Data.SqlClient;
namespace DAO
{
    public class KhachHangDAO
    {
        public static List<KhachHangDTO> SelectKhachHangAll()
        {
            List<KhachHangDTO> list = new List<KhachHangDTO>();
            try
            {
                DataTable dt = DataProvider.ExecuteQuery("sp_SelectKhachHangALL");
                foreach (DataRow dr in dt.Rows)
                {
                    KhachHangDTO kh = new KhachHangDTO();
                    kh.MAKH = dr["MAKH"].ToString();
                    kh.TEN = dr["TEN"].ToString();
                    kh.DCHI = dr["DCHI"].ToString();
                    kh.DTHOAI = dr["DTHOAI"].ToString();
                    list.Add(kh);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return list;
        }
    }
}
